<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon32.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon16.ico?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="CG,">










<meta name="description" content="球谐函数是定义在球面上的特殊函数，其组成了一个正交函数的完备集合（正交基）。在CG里，基本上只要需要间接光照（AO，GI，PRT），就会用到球谐函数编码。">
<meta name="keywords" content="CG">
<meta property="og:type" content="article">
<meta property="og:title" content="Spherical Harmonics">
<meta property="og:url" content="http://htelepathh.gitee.io/2022/05/01/Spherical-Harmonics/index.html">
<meta property="og:site_name" content="OUTPUT">
<meta property="og:description" content="球谐函数是定义在球面上的特殊函数，其组成了一个正交函数的完备集合（正交基）。在CG里，基本上只要需要间接光照（AO，GI，PRT），就会用到球谐函数编码。">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://htelepathh.gitee.io/2022/05/01/Spherical-Harmonics/Sphericalfunctions.jpg">
<meta property="og:image" content="http://htelepathh.gitee.io/2022/05/01/Spherical-Harmonics/basic_idea.jpg">
<meta property="og:image" content="http://htelepathh.gitee.io/2022/05/01/Spherical-Harmonics/diffuse_case.jpg">
<meta property="og:image" content="http://htelepathh.gitee.io/2022/05/01/Spherical-Harmonics/glossy_case.jpg">
<meta property="og:updated_time" content="2022-05-09T08:28:35.081Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Spherical Harmonics">
<meta name="twitter:description" content="球谐函数是定义在球面上的特殊函数，其组成了一个正交函数的完备集合（正交基）。在CG里，基本上只要需要间接光照（AO，GI，PRT），就会用到球谐函数编码。">
<meta name="twitter:image" content="http://htelepathh.gitee.io/2022/05/01/Spherical-Harmonics/Sphericalfunctions.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":true},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://htelepathh.gitee.io/2022/05/01/Spherical-Harmonics/">





  <title>Spherical Harmonics | OUTPUT</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">OUTPUT</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">HTelepathH's blog</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-message">
          <a href="/message" rel="section">
            
            留言
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://htelepathh.gitee.io/2022/05/01/Spherical-Harmonics/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="HTelepathH">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/MOB.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="OUTPUT">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Spherical Harmonics</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2022-05-01T12:48:36+08:00">
                2022-05-01
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/math/" itemprop="url" rel="index">
                    <span itemprop="name">math</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>球谐函数是定义在球面上的特殊函数，其组成了一个正交函数的完备集合（正交基）。在CG里，基本上只要需要间接光照（AO，GI，PRT），就会用到球谐函数编码。<br><a id="more"></a></p>
<h3 id="Inference"><a href="#Inference" class="headerlink" title="Inference"></a>Inference</h3><p>球谐函数是Laplace’s equation的球坐标系形式解的角度部分</p>
<script type="math/tex; mode=display">
\nabla ^{2}f={\frac {1}{r^{2} }}{\frac {\partial }{\partial r} }\left(r^{2}{\frac {\partial f}{\partial r} }\right)+{\frac {1}{r^{2}\sin \theta } }{\frac {\partial }{\partial \theta } }\left(\sin \theta {\frac {\partial f}{\partial \theta } }\right)+{\frac {1}{r^{2}\sin ^{2}\theta } }{\frac {\partial ^{2}f}{\partial \varphi ^{2} }}=0</script><p>设定解为$f(r,\ \theta ,\ \varphi )$形式，$Y(\theta ,\ \varphi )$为角度部分解，也就是球谐函数</p>
<script type="math/tex; mode=display">
f(r,\ \theta ,\ \varphi )=R(r)Y(\theta ,\ \varphi )=R(r)\Theta (\theta )\Phi (\varphi)</script><p>带入$f$，并使用<a href="https://en.wikipedia.org/wiki/Separation_of_variables#pde" target="_blank" rel="noopener"><strong>分离变量法</strong></a>，进行整理</p>
<script type="math/tex; mode=display">
\begin{cases}
    \dfrac {1}{R}{\dfrac {d}{dr} }\left(r^{2}{\dfrac {dR}{dr} }\right)=\lambda \\
    {\dfrac {1}{\Phi } }{\dfrac {d^{2}\Phi }{d\varphi ^{2} }}=-m^{2}\\
    \lambda +{\dfrac {1}{\Theta \sin \theta } }{\dfrac {d}{d\theta } }\left(\sin \theta {\dfrac {d\Theta }{d\theta } }\right)-{\dfrac {m^{2} }{\sin ^{2}\theta } }=0
\end{cases}
\Rightarrow
\begin{cases}
r^{2}R''+2rR'-\lambda R=0\\
\Phi ''+m^{2}\Phi =0\\
\sin \theta {\dfrac {d}{d\theta } }(\sin \theta \Theta ')+(\lambda \sin ^{2}\theta -m^{2})\Theta =0
\end{cases}</script><h4 id="solution"><a href="#solution" class="headerlink" title="solution"></a>solution</h4><h5 id="Phi"><a href="#Phi" class="headerlink" title="$\Phi$"></a>$\Phi$</h5><p>对于$\Phi$是以$2\pi$为周期的函数</p>
<script type="math/tex; mode=display">
\Phi =e^{im\phi},m\in \mathbb {Z}</script><h5 id="Theta"><a href="#Theta" class="headerlink" title="$\Theta$"></a>$\Theta$</h5><p><strong>General Legendre Equation</strong><br>广义Legendre equation如下</p>
<script type="math/tex; mode=display">
\frac {d}{dx}\left[\left(1-x^{2}\right){\frac {d}{dx} }y\right]+\left[\ell (\ell +1)-{\frac {m^{2} }{1-x^{2} }}\right]y=0</script><p>仅当$0\leq m\leq l$是在[-1,1]上有非奇异解。当$m=0$时则退化为普通的Legendre equation。</p>
<p>$P^m_l(x)$[Associated Legendre polynomials(ALP)]为广义Legendre equation的解，把方程展开如下</p>
<script type="math/tex; mode=display">
\left(1-x^{2}\right){\frac {d^{2} }{dx^{2} }}P_{\ell }^{m}(x)-2x{\frac {d}{dx} }P_{\ell }^{m}(x)+\left[\ell (\ell +1)-{\frac {m^{2} }{1-x^{2} }}\right]P_{\ell }^{m}(x)=0</script><p>对于$\Theta$，换元$t=\cos\theta$，方程可以化简为相同形式</p>
<script type="math/tex; mode=display">
\frac {d}{dt}\left[\left(1-t^{2}\right){\frac {d}{dt} }\Theta\right]+\left[\lambda-{\frac {m^{2} }{1-t^2} }\right]\Theta=0</script><p>对应$\lambda=\ell (\ell +1)$，所以</p>
<script type="math/tex; mode=display">\Theta =P_{\ell }^{m}(\cos \theta )</script><h5 id="Final-Formation"><a href="#Final-Formation" class="headerlink" title="Final Formation"></a>Final Formation</h5><p>最终形式如下，其中$N$为归一化项。</p>
<script type="math/tex; mode=display">
Y_{\ell }^{m}(\theta ,\varphi )=N\Phi (\varphi )\Theta (\theta )=N\,e^{im\varphi }\,P_{\ell }^{m}(\cos {\theta }),\\l\in \mathbb {N} ,m=0,\pm 1,\pm 2,\ldots \pm l</script><p>展开归一项</p>
<script type="math/tex; mode=display">
Y_{\ell }^{m}(\theta ,\ \varphi )=(-1)^{m}{\sqrt { {(2\ell +1) \over 4\pi }{(\ell -|m|)! \over (\ell +|m|)!} }}\,P_{\ell }^{m}(\cos {\theta })\,e^{im\varphi }</script><h3 id="Basis-functions"><a href="#Basis-functions" class="headerlink" title="Basis functions"></a>Basis functions</h3><p>之前推导的球谐为复数形式，在图形学应用中只需要实数形式（不关心相位）</p>
<script type="math/tex; mode=display">
\begin{align*}
y^{m > 0}_l &= \sqrt{2} K^m_l cos(m \phi) P^m_l(cos \theta) \\
y^{m < 0}_l &= \sqrt{2} K^m_l sin(m \phi) P^{-m}_l(cos \theta) \\
y^0_l &= K^0_l P^0_l(cos \theta)
\end{align*}</script><p>其中归一化因子$K^m_l$为</p>
<script type="math/tex; mode=display">
K^m_l = \sqrt{\frac{(2l + 1)(l - |m|)!}{4 \pi (l + |m|)!} }</script><p>$P_n(x)$为Legendre多项式（LP）</p>
<script type="math/tex; mode=display">
P_n(x)=\frac{1}{2^n\cdot n!}\frac{d^n}{dx^n}[(x^2-1)^n]</script><p>$P^m_l(x)$为伴随Legendre多项式(ALP)，由LP定义。$P^m_l(x)\in[-1,1]$</p>
<script type="math/tex; mode=display">
P^m_l(x) = (-1)^m  (1 - x^2)^{\frac{m}{2} }\frac{d^m}{dx^m}(P_l(x))</script><p>$l,m\in\text{Z}^*,m\in[0,l]$。$l,m$分别是ALP的”degree/band index”和”order”。</p>
<p>$P^m_l(x)$可以由递推得出</p>
<script type="math/tex; mode=display">
\begin{align*}
P^l_{l+1}(x) &= x(2l+1)P^l_l\\
P^l_l(x) &= (-1)^l (2l - 1)!! (1 - x^2)^{\frac{l}{2} } \\
P^m_l(x) &= \frac{((2l - 1) x P^m_{l - 1} - (l + m - 1) P^m_{l - 2})}{l - m}
\end{align*}</script><p>前三阶的归一化SH基函数$Y^m_l(s)$</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center">Band</th>
<th style="text-align:center">$m=-2$</th>
<th style="text-align:center">$m=-1$</th>
<th style="text-align:center">$m=0$</th>
<th style="text-align:center">$m=1$</th>
<th style="text-align:center">$m=2$</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">$l=0$</td>
<td style="text-align:center"></td>
<td style="text-align:center"></td>
<td style="text-align:center">$\frac{1}{2}\sqrt{\frac{1}{\pi} }$</td>
<td style="text-align:center"></td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">$l=1$</td>
<td style="text-align:center"></td>
<td style="text-align:center">$-\frac{1}{2}\sqrt{\frac{3}{\pi} }y$</td>
<td style="text-align:center">$\frac{1}{2}\sqrt{\frac{3}{\pi} }z$</td>
<td style="text-align:center">$-\frac{1}{2}\sqrt{\frac{3}{\pi} }x$</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">$l=2$</td>
<td style="text-align:center">$\frac{1}{2}\sqrt{\frac{15}{\pi} }xy$</td>
<td style="text-align:center">$-\frac{1}{2}\sqrt{\frac{15}{\pi} }yz$</td>
<td style="text-align:center">$\frac{1}{4}\sqrt{\frac{5}{\pi} }(2z^2 - x^2 - y^2)$</td>
<td style="text-align:center">$-\frac{1}{2}\sqrt{\frac{15}{\pi} }xz$</td>
<td style="text-align:center">$\frac{1}{4}\sqrt{\frac{15}{\pi} }(x^2-y^2)$</td>
</tr>
</tbody>
</table>
</div>
<img src="/2022/05/01/Spherical-Harmonics/Sphericalfunctions.jpg" title="Spherical Harmonics Basises">
<h3 id="Decomposition-and-reconstruction"><a href="#Decomposition-and-reconstruction" class="headerlink" title="Decomposition and reconstruction"></a>Decomposition and reconstruction</h3><p>将一个球面函数$L(s)$投影到球谐基上，只需与对应基卷积，得到该基函数的系数$L^m_l$</p>
<script type="math/tex; mode=display">
L^m_l = \int_\Omega L(s) y^m_l(s) ds \\
L^m_l = \int_{\theta = 0}^{\pi} \int_{\phi = 0}^{2\pi} L(\theta, \phi) y^m_l(\theta, \phi) sin \theta d\theta d\phi</script><p>每个系数系数$L^m_l$都是一个vec3对应RGB，所以前三阶球谐共有(1+3+5)*3=27个系数。这样的系数显然需要Monte Carlo采样来计算，也可以用上重要性采样，比如对于光源采样</p>
<p>重建只需要一个简单的点积</p>
<script type="math/tex; mode=display">
\hat{L}(s) = \sum_l \sum_{m = -l}^l L^m_l y^m_l(s)</script><h3 id="Sample-of-left-lt-cos-theta-right-gt"><a href="#Sample-of-left-lt-cos-theta-right-gt" class="headerlink" title="Sample of $\left&lt;\cos\theta\right&gt;$"></a>Sample of $\left&lt;\cos\theta\right&gt;$</h3><h4 id="Decomposition"><a href="#Decomposition" class="headerlink" title="Decomposition"></a>Decomposition</h4><p>对于最简单的截断余弦$\left&lt;\cos\theta\right&gt;$进行投影，由于与$\phi$无关，所以卷积可化简为</p>
<script type="math/tex; mode=display">
\begin{align*}
C^0_l &= 2\pi \int_0^{\pi} \left< cos \theta \right> y^0_l(\theta) sin \theta d\theta \\
C^0_l &= 2\pi K^0_l \int_0^{\frac{\pi}{2} } P^0_l(cos \theta) cos \theta sin \theta d\theta \\
C^m_l &= 0, m != 0
\end{align*}</script><p>解析解为</p>
<script type="math/tex; mode=display">
\begin{align*}
C_1 &= \sqrt{\frac{\pi}{3} } \\
C_{odd} &= 0 \\
C_{l, even} &= 2\pi \sqrt{\frac{2l + 1}{4\pi} } \frac{(-1)^{\frac{l}{2} - 1} }{(l + 2)(l - 1)} \frac{l!}{2^l (\frac{l!}{2})^2}
\end{align*}</script><h4 id="Convolution"><a href="#Convolution" class="headerlink" title="Convolution"></a>Convolution</h4><p>与圆对称的核函数$h$的卷积可以再SH空间直接apply</p>
<script type="math/tex; mode=display">
(h * f)^m_l = \sqrt{\frac{4\pi}{2l + 1} } h^0_l(s) f^m_l(s)</script><p>可以发现</p>
<script type="math/tex; mode=display">\sqrt{\frac{4\pi}{2l + 1} } = \frac{1}{K^0_l}</script><p>所以在实践中一般先把$C_l$乘上$\frac{1}{K^0_l}$。表达式可以化简</p>
<script type="math/tex; mode=display">
\begin{align*}
\hat{C}_{l, even} &= 2\pi \frac{(-1)^{\frac{l}{2} - 1} }{(l + 2)(l - 1)} \frac{l!}{2^l (\frac{l!}{2})^2} \\
\hat{C}_1 &= \frac{2\pi}{3}
\end{align*}</script><h3 id="Rotation"><a href="#Rotation" class="headerlink" title="Rotation"></a>Rotation</h3><p><a href="http://filmicworlds.com/blog/simple-and-fast-spherical-harmonic-rotation/" target="_blank" rel="noopener">Simple and Fast Spherical Harmonic Rotation</a></p>
<h3 id="Precomputed-Radiance-Transfer-PRT"><a href="#Precomputed-Radiance-Transfer-PRT" class="headerlink" title="Precomputed Radiance Transfer (PRT)"></a>Precomputed Radiance Transfer (PRT)</h3><p>lighting部分可以视为球面函数用SH表示，同样lighting transport的部分也可以。PRT同时隐含了BRDF和法线信息，代价是每个顶点都需要一组SH系数</p>
<img src="/2022/05/01/Spherical-Harmonics/basic_idea.jpg" title="Basic idea of PRT">
<h4 id="Diffuse-case"><a href="#Diffuse-case" class="headerlink" title="Diffuse case"></a>Diffuse case</h4><p>Lambertian BRDF可以直接作为系数提到积分外。这样light transport的部分只与是关于$l$的球面分布，可以用SH表示。</p>
<img src="/2022/05/01/Spherical-Harmonics/diffuse_case.jpg" title="Diffuse case">
<p>Diffuse的情况在运行时为点积。<br></p>
<h4 id="Glossy-case"><a href="#Glossy-case" class="headerlink" title="Glossy case"></a>Glossy case</h4><p>Glossy BRDF的传输矩阵为二维，因为BRDF对于每个$v$都需要有$l$</p>
<img src="/2022/05/01/Spherical-Harmonics/glossy_case.jpg" title="Glossy case">
<p>Glossy的情况在运行时为向量和矩阵相乘。</p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/CG/" rel="tag"># CG</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2022/04/23/Material-System-in-Filament-材质模型/" rel="next" title="Material System in Filament : 材质模型">
                <i class="fa fa-chevron-left"></i> Material System in Filament : 材质模型
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2022/05/05/Lighting-in-Filament-IBL/" rel="prev" title="Lighting in Filament : IBL">
                Lighting in Filament : IBL <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
      <div id="sidebar-dimmer"></div>
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/MOB.jpg" alt="HTelepathH">
            
              <p class="site-author-name" itemprop="name">HTelepathH</p>
              <p class="site-description motion-element" itemprop="description">Learning by doing.</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives">
              
                  <span class="site-state-item-count">25</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">12</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">15</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="99088577@qq.com" target="_blank" title="Mail">
                      Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://gitee.com/htelepathh" target="_blank" title="Gitee">
                      Gitee</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/htlpt" target="_blank" title="GitHub">
                      GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/u/6207125886" target="_blank" title="微博">
                      微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.zhihu.com/people/huang-he-tu" target="_blank" title="知乎">
                      知乎</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#Inference"><span class="nav-number">1.</span> <span class="nav-text">Inference</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#solution"><span class="nav-number">1.1.</span> <span class="nav-text">solution</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#Phi"><span class="nav-number">1.1.1.</span> <span class="nav-text">$\Phi$</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Theta"><span class="nav-number">1.1.2.</span> <span class="nav-text">$\Theta$</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Final-Formation"><span class="nav-number">1.1.3.</span> <span class="nav-text">Final Formation</span></a></li></ol></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Basis-functions"><span class="nav-number">2.</span> <span class="nav-text">Basis functions</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Decomposition-and-reconstruction"><span class="nav-number">3.</span> <span class="nav-text">Decomposition and reconstruction</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Sample-of-left-lt-cos-theta-right-gt"><span class="nav-number">4.</span> <span class="nav-text">Sample of $\left&lt;\cos\theta\right&gt;$</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Decomposition"><span class="nav-number">4.1.</span> <span class="nav-text">Decomposition</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Convolution"><span class="nav-number">4.2.</span> <span class="nav-text">Convolution</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Rotation"><span class="nav-number">5.</span> <span class="nav-text">Rotation</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Precomputed-Radiance-Transfer-PRT"><span class="nav-number">6.</span> <span class="nav-text">Precomputed Radiance Transfer (PRT)</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Diffuse-case"><span class="nav-number">6.1.</span> <span class="nav-text">Diffuse case</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Glossy-case"><span class="nav-number">6.2.</span> <span class="nav-text">Glossy case</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-angle-double-left"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">HTelepathH</span>

  
</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          displayMath: [ ['$$', '$$']],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


  

  

</body>
</html>
